{% extends "base3-left.html" %}
{% load staticfiles %}
{% load mytags %}

{% block title %}医院评审管理系统{% endblock %}

{% block content %}
<!-- Content Header (Page header) -->
<section class="content-header margin-bottom">
  <ol class="breadcrumb">
    <li><a href=""><i class="fa fa-dashboard"></i>评审系统</a></li>
    <li class="active"><a href="{% url 'criteria' %}">评审标准</a></li>

      	 {% ifequal criteria_id 1 %}
       <li class="active"><a href="{% url 'criteria_bid' 1 %}">{{ criteria.name }}</a></li>
      {% endifequal %}
    	 {% ifequal criteria_id 2 %}
  <li class="active"><a href="{% url 'criteria_bid' 2 %}">{{ criteria.name }}</a></li>
      {% endifequal %}
      	 {% ifequal criteria_id 3 %}
  <li class="active"><a href="{% url 'criteria_bid' 3 %}">{{ criteria.name }}</a></li>
      {% endifequal %}


  </ol>
</section>
 <section class="content">
     <div id="devlist">
     <div class="box box-primary" id="liebiao">
          <div id="docs-body" class="container">
        <div class="page-header">
            <h2>
{#                三级综合医院评审标准<small>（2011版）</small>#}
                {{ criteria.name }}
            </h2>
        </div>
        <div id="lookup-page">

            <div class="row">

                <div class="criteria-nav col-md-12">
                   <ul class="l1list nav nav-pills mg-b-15">
                        {% for item in level1_all %}
                            <li
                                {% if item.id == clause_parent.id %}
                        class="active"
                        {% endif %}
                        >
                            <a href="{% url 'criterion_bid_cid' criteria_id item.id  %}"><i class="icon-tags"></i>{{ item.desc }}</a>
                        </li>
                        {% endfor %}

                    </ul>
<hr>
                    <ul class="l2list nav nav-pills">
                        {% for l2_item in level2_all %}
                        <li
                                {% if l2_item.id == clause_now.id %}
                        class="active"
                        {% endif %}
                        >
                             <a href="{% url 'criterion_bid_cid' criteria_id l2_item.id  %}"><i class="icon-bookmark"></i> {{ l2_item.desc }}</a>
                        </li>
                        {% endfor %}
                    </ul>
<hr>

                </div>

            </div>
{% for l3_item in level3_all %}
            <div class="l3item">
                <h4>
                    {{ l3_item.name }} {{ l3_item.desc }}
                </h4>
 {# 判断是否有四级节点,如果有四级节点则显示四级节点，四级节点下显示叶子节点  #}

            {% if l3_item.id|get_level4_clause %}
                {% for l4_item in l3_item.id|get_level4_clause %}
                    <h5>
                    {{ l4_item.name }} {{ l4_item.desc }}
                </h5>
                     {% for l6_item in l4_item.id|get_level6_clause %}
                         {% show_keys_and_refs l6_item.id is_superuser %}
                     {% endfor %}
                {% endfor %}
            {% else %}  {# 如果下面没有四级节点,直接显示叶子节点  #}
                {% for l6_item in l3_item.id|get_level6_clause %}
                  {% show_keys_and_refs l6_item.id is_superuser %}
                {% endfor %}

            {% endif %}
            </div>
{% endfor %}

        </div>
          </div>
     </div>
          </div>
  </section>
{% endblock %}

{% block javascripts %}
    <script src="/static/js/plugins/layer/layer.js"></script>
  <script type="text/javascript">
	$(function() {
		$('#index').addClass('active');
	 {% ifequal criteria_id 1 %}
      $('#CRITERIA-1').addClass('active');
      {% endifequal %}
    	 {% ifequal criteria_id 2 %}
      $('#CRITERIA-2').addClass('active');
      {% endifequal %}
       	 {% ifequal criteria_id 3 %}
      $('#CRITERIA-3').addClass('active');
      {% endifequal %}
	});
	function doUpdate(clause_id,ref_type){
	layer.open({
		type : 2,
		title : '编辑参考资料',
		shadeClose : false,
    	maxmin : true,
		area : [ '850px', '600px' ],
		content : [ "{% url 'criterion-reference' %}"+'?clause_id='+clause_id+'&ref_type='+ref_type, 'no' ],
{#		content : [ "{% url '/xadmin/criterion/reviewreference/5/update/' %}"+'?id='+id, 'no' ],#}
		end : function() {
{#			oDataTable.ajax.reload();#}
			window.location.reload();
		}
	});
}
  </script>
{% endblock %}
